package com.lottery.system.common.exception;
import com.lottery.system.common.errorcode.ErrorCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * Description: 控制层的异常
 * Param: * @param null
 * return:
 * @Author: xiaoxie
 * Date: 22:17 2024/8/27
*/

@EqualsAndHashCode(callSuper=true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ControllerException extends RuntimeException{
    /**
     * 错误码
     * @see com.lottery.system.common.errorcode.ControllerErrorCodeConstants
    */
    private Integer code;

    /**
     * 错误信息
    */ 
    private String msg;
    
    public ControllerException(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
    }
}
